package org.ch00.test04.demo03;

/**
 * @author CSY
 * @date 2025 - 03 - 03
 */
public class Musician {
    private String name;
    private int age;

    public Musician() {}

    public Musician(String name, int age) {
        this.name = name;
        this.age = age;
    }

    /**
     * 演奏
     * @param instrument 乐器
     */
    public void rendition(Instrument instrument) {
        System.out.println(this.name + "使用" + instrument.getBrand() +"进行演奏");
        instrument.sound();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
